package com.sailfish.springbootdemo.pojo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

@Configuration
public class JwtProperties {

    //给静态变量赋值
    @Value("${personal.config.jwt.expiration-time}")
    public Integer expirationTime;

    @Value("${personal.config.jwt.sign}")
    public String sign;

    public void setExpirationTime(Integer expirationTime) {
        this.expirationTime = expirationTime;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    public static Integer EXPIRATION_TIME;
    public static String SIGN;

    @PostConstruct
    public void init() {
        JwtProperties.EXPIRATION_TIME = expirationTime;
        JwtProperties.SIGN = sign;
    }

}